class PondSeat {
  final int id;
  final int pondId;
  final String pondName;
  final int deptId;
  final String deptName;
  final String code;
  final int status;
  final int priceSegmentId;
  final int reservable;
  final int price;
  final String? remark;
  final String? createBy;
  final DateTime? createTime;
  final String? updateBy;
  final DateTime? updateTime;
  final bool? isBatch;
  final int? batchCount;
  final String? codePrefix;

  PondSeat({
    required this.id,
    required this.pondId,
    required this.pondName,
    required this.deptId,
    required this.deptName,
    required this.code,
    required this.status,
    required this.priceSegmentId,
    required this.reservable,
    required this.price,
    this.remark,
    this.createBy,
    this.createTime,
    this.updateBy,
    this.updateTime,
    this.isBatch,
    this.batchCount,
    this.codePrefix,
  });

  factory PondSeat.fromJson(Map<String, dynamic> json) {
  try {
    return PondSeat(
      id: json['id'],
      pondId: json['pondId'],
      pondName: json['pondName'],
      deptId: json['deptId'],
      deptName: json['deptName'],
      code: json['code'],
      status: json['status'],
      priceSegmentId: json['priceSegmentId'],
      reservable: json['reservable'],
      price: (json['price'] == null) ? 0 : (json['price'] as num).toInt(),
      remark: json['remark'],
      createBy: json['createBy'],
      createTime: json['createTime'] != null ? DateTime.parse(json['createTime']) : null,
      updateBy: json['updateBy'],
      updateTime: json['updateTime'] != null ? DateTime.parse(json['updateTime']) : null,
      isBatch: json['isBatch'],
      batchCount: json['batchCount'],
      codePrefix: json['codePrefix'],
    );
  } catch (e, stack) {
    rethrow;
  }
}
 
  @override
  String toString() {
    return 'PondSeat(id: $id, pondId: $pondId, pondName: $pondName, deptId: $deptId, '
        'deptName: $deptName, code: $code, status: $status, priceSegmentId: $priceSegmentId, '
        'reservable: $reservable, price: $price, remark: $remark, createBy: $createBy, '
        'createTime: $createTime, updateBy: $updateBy, updateTime: $updateTime, '
        'isBatch: $isBatch, batchCount: $batchCount, codePrefix: $codePrefix)';
  }
}
